from app import db

# 一个订单可以有多个订单详情表

class PayOrderDetail(db.Model):
    __tablename__ = 'pay_order_detail'

    id = db.Column(db.Integer, primary_key=True)
    pay_order_id = db.Column(db.Integer, nullable=False, index=True, comment='订单id')
    member_id = db.Column(db.BigInteger, nullable=False, comment='会员id')
    food_id = db.Column(db.Integer, nullable=False, index=True, comment='美食表id')
    quantity = db.Column(db.Integer, nullable=False,server_default="1", default=1, comment='购买数量 默认1份')
    price = db.Column(db.Numeric(10, 2), nullable=False, comment='同一类商品总价格,售价 * 数量')
    created_time = db.Column(db.DateTime, nullable=False, comment='订单id')

